All Questions
8 questions
0votes
1answer
332views
Shell script not picking up variable in if statement
I have some code that looks like this: ################### - Let's call this section 1 if [ -n "$STUFF_JAVA" ]; then __LAUNCHER="$STUFF_JAVA" else __LAUNCHER="...
-1votes
2answers
730views
How to get all the contents of df -h command as string
I want to have a CRON job which calls a Java program to send a mail if disk space is more than 80%. Along with it, I want to send the contents of the df -h command also. What I did was create a ...
0votes
1answer
754views
bash file contain executable/binary code
I found this tool and when I downloaded it is a bash executable that contains binary code. First of all I didn't know this is possible. Does anyone know who this can be done? Also I am not sure how ...
0votes
1answer
3kviews
ansible and expect problem
I want to use expect tools in bash script by ansible. first, step my shell script. Checking for $JAVA_HOME variable. I set $JAVA_HOME but in Ansible, I get an error. My env for $JAVA_HOME: [root@...
0votes
1answer
17kviews
Any possibility to execute shell script from java file?
I have one Java file named app.java which extracts the servers in my application. I need to connect to every server in that list and extract the logs. In loop, I have to call script for connecting to ...
2votes
1answer
4kviews
How to get binary representations of strings in Shell?
I'm using openssl dgst -sha1 -binary to get hash values of my strings in binary format. (I'm using -binary flag because my version of openssl adds "stdout" before each hash value on default output, ...
3votes
3answers
3kviews
grep on a Java Method
Lets say I have a java class called DirectAction some of the methods in the class have the word "action" or "Action" What is the grep command to get the names of all the methods who have "Action" or ...
1vote
2answers
1kviews
Run jar on startup in all *nix based systems
I have a jar file which I need to run at startup in all distros of Linux. My previous question here, gave me an idea a rough idea on X-servers. Since I wasn't able to perform startup, I moved on to ...